﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using DeviceFinder.DAL;
using DeviceFinder.Models;

namespace DeviceFinder.Controllers
{
    public class AccessTokenController : ApiController
    {
        // GET api/accesstoken
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/accesstoken/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/accesstoken
        public AccessToken Post([FromBody]AccessTokenModel value)
        {
            AccessToken token = null;
            //Tạo token
            token = OAuthManager.CreateAccessToken(value.RequestToken, value.IdDevice);

            return token;
        }

        // PUT api/accesstoken/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/accesstoken/5
        public void Delete(int id)
        {
        }
    }
}
